x86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU.
authorKeir Fraser <keir@xen.org>
Tue, 16 Nov 2010 11:44:09 +0000 (11:44 +0000)
committerKeir Fraser <keir@xen.org>
Tue, 16 Nov 2010 11:44:09 +0000 (11:44 +0000)
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/vpmu.c

index f1917601ec53c630fe20befd6285f381e4507b99..5214529a4ed319055e0b0fc44759ca53d3f3ac45 100644 (file)
@@ -97,43 +97,43 @@ void vpmu_initialise(struct vcpu *v)
 
     switch ( vendor )
     {
-        case X86_VENDOR_AMD:
+    case X86_VENDOR_AMD:
+        switch ( family )
         {
-            switch ( family )
-            {
-            case 0x10:
-                vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-                break;
-            default:
-                printk("VMPU: Initialization failed. "
-                       "AMD processor family %d has not "
-                       "been supported\n", family);
-                return;
-            }
+        case 0x10:
+            vpmu->arch_vpmu_ops = &amd_vpmu_ops;
+            break;
+        default:
+            printk("VPMU: Initialization failed. "
+                   "AMD processor family %d has not "
+                   "been supported\n", family);
+            return;
         }
         break;
 
-        case X86_VENDOR_INTEL:
+    case X86_VENDOR_INTEL:
+        if ( family == 6 )
         {
-            if ( family == 6 )
+            switch ( cpu_model )
             {
-                switch ( cpu_model )
-                {
-                case 15:
-                case 23:
-                case 26:
-                case 29:
-                    vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-                    break;
-                }
+            case 15:
+            case 23:
+            case 26:
+            case 29:
+                vpmu->arch_vpmu_ops = &core2_vpmu_ops;
+                break;
             }
         }
+        if ( vpmu->arch_vpmu_ops == NULL )
+            printk("VPMU: Initialization failed. "
+                   "Intel processor family %d model %d has not "
+                   "been supported\n", family, cpu_model);
         break;
 
-        default:
-            printk("VMPU: Initialization failed. "
-                   "Unknown CPU vendor %d\n", vendor);
-            return;
+    default:
+        printk("VPMU: Initialization failed. "
+               "Unknown CPU vendor %d\n", vendor);
+        break;
     }
 
     if ( vpmu->arch_vpmu_ops != NULL )